package com.shazam.test.activity;

import com.shazam.test.R;
import com.shazam.test.util.Consts;

import android.app.Activity;
import android.app.ProgressDialog;
import android.os.Bundle;
import android.webkit.WebView;
import android.webkit.WebViewClient;

public class SingleMenuItemActivity extends Activity {

	public void onCreate(Bundle savedInstanceState) {

		WebView mWebView;

		super.onCreate(savedInstanceState);
		setContentView(R.layout.single_list_item);
		final ProgressDialog pd = ProgressDialog.show(this, "", getResources()
				.getString(R.string.loading), true);
		mWebView = (WebView) findViewById(R.id.webview);
		mWebView.getSettings().setBuiltInZoomControls(true);
		mWebView.setWebViewClient(new WebViewClient() {
			@Override
			public void onPageFinished(WebView view, String url) {
				if (pd.isShowing() && pd != null) {
					pd.dismiss();
				}
			}
		});
		mWebView.getSettings().setLoadWithOverviewMode(true);
		mWebView.getSettings().setUseWideViewPort(true);

		/**
		 * set a different user agent
		 */
		mWebView.getSettings().setUserAgentString(Consts.UA);

		String weblink = getIntent().getStringExtra("link");
		mWebView.loadUrl(weblink);
	}

}
